<?php
/*
*  -------------------------------------------------
*   @file		: .php
*   @link		:CPC  www.chinapet.com
*   @copyright	: 2002-2012 Xingmo Inc
*   @author		: Laipiyang <462166282@qq.com>
*   @blog_url   : http://www.icuir.com/
*   @blog_url   : http://blog.sina.com.cn/xmphp
*   @date		:
*   @update		:
*  -------------------------------------------------
*/
require_once "./include/init.inc.php";
checklogin();
$filename=basename(__file__);
$act=isset ( $_GET['act'] ) ? trim ( $_GET['act'] ) : '' ;
if($act=='add')
{
	echo 1;
}
else if ($act=='insert')
{
	echo 2;
}
else if ($act=='edit')
{
   echo 3;
}
else if ($act=='check')
{
   $id=isset ( $_GET['id'] ) ? intval ( $_GET['id'] ) : '' ;
   if($id=='')
   {
	  alert('操作非法');
	  exit;
   }
   $sql="UPDATE `info_user_pet` SET `pic`=''  WHERE `id`='{$id}' ";  //如果用户的图片是非法的就审核不通过...
   $res=$db->query($sql);
   if($res)
   {
	  alert('审核成功',$filename);
	  exit;
   }
   else
   {
	  alert('审核失败',$filename);
	  exit;
   }
}
else if ($act=='update')
{
   echo 4;
}else if ($act=='del')
{
  echo 5;
}
else
{
	//echo 7;
	$smarty->assign('pl',$p=licuicui_page($db->num_rows($db->query("SELECT * FROM `info_user_pet` ")),$filename,10));
	$smarty->assign('list',$db->fetch_all("SELECT c .* , l.`nick` FROM`info_user_pet`AS c  LEFT JOIN `info_link_user`AS l ON c.`user_id`=l.`id` LIMIT {$p['start']},{$p['pagesize']}"));
	$smarty->assign('web',array('title'=>'审核宠物列表'));
	$smarty->display(ADMIN_TPL.'pet_admit_list.dwt');

}
?>